package com.guigu.controller;

import com.guigu.dto.ClassifyDTO;
import com.guigu.entity.Classify_detail;
import com.guigu.vo.Result;
import com.guigu.entity.Classify_detail1;
import com.guigu.entity.Ressksisys;
import com.guigu.service.ClassifyService;
import com.guigu.vo.MemberVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/Classify")
public class ClassifyController {

    @Autowired
    private ClassifyService classifyService;

    @PostMapping("/queryClassify")
    @ResponseBody
        public List<MemberVO> queryClassify(@RequestBody ClassifyDTO classifyDTO){
        return classifyService.queryClassify(classifyDTO);
    }

    @GetMapping("/deleteByClassifyId")
    public int deleteByClassifyId(int ber_id){
        return classifyService.deleteByClassifyId(ber_id);
    }

    @PostMapping("/queryriskkAssessment")
    @ResponseBody
    public List<Ressksisys> queryriskkAssessment(){
        return this.classifyService.queryriskkAssessment();
    }

    @GetMapping("/queryriskkAssessmentByFileNumber")
    @ResponseBody
    public Result<Ressksisys> queryriskkAssessmentByFileNumber(String FileNumber){
        System.out.println(FileNumber);
        Ressksisys ressksisys = this.classifyService.queryriskkAssessmentByFileNumber(FileNumber);
        System.out.println(ressksisys);
        return new Result<>("200", "true", "成功查询风险评估", ressksisys);
    }

    @PostMapping("/insertClassify")
    public void insertClassify(@RequestBody Classify_detail1 classify){
        System.out.println(classify);
        this.classifyService.insertClassify(classify);
    }
}
